<template>
  <div>
    <!-- <h3>详情页面 --- {{ $route.params.nid || 0 }} == {{ nid }}</h3> -->
    <!-- <h3>{{ info?.title }}</h3> -->
    <!-- 条件渲染 -->
    <template v-if="info == null">
      <loading />
    </template>
    <template v-else>
      <h3>{{ info.title }}</h3>
      <hr />
      <div v-html="info.body"></div>
    </template>
  </div>
</template>

<script>
import { get } from '@/utils/http'
export default {
  data() {
    return {
      info: null
    }
  },
  computed: {
    nid() {
      return this.$route.params.nid || 0
    }
  },
  async mounted() {
    // console.log(this.$route.query)
    // console.log(+this.$route.query.name)
    let nid = this.$route.params.nid || 0
    // 进行网络请求
    // this.info = xxx
    let ret = await get('/mock/news.json')
    this.info = ret
  },
  methods:{
    filterIframe(html){
      // iframe替换掉
    }
  }
}
</script>

<style lang="scss" scoped></style>
